I had a similar issue a few days back with Xcode 11.4, but I was on Big Sur 11.2.2. Not sure if this will help you but I read somewhere on SO that it was a bug to do with any physical device you had connected to Xcode to run your app on with connect via network checked. So for me I simply unpaired any devices I had connected to Xcode and only tested on the simulators, which worked fine and stopped Xcode from freezing literally every time I done anything.
I had already tried restarting everything, etc, etc but nothing worked until I unpaired any physical devices. I've since updated to Big Sur 11.2.3 and repaired my iPhone to Xcode, so far haven't had any issues with it freezing.
Thought the new OS update fixed it but reading your post I guess not. Hope I helped.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: